import org.bouncycastle.jce.provider.BouncyCastleProvider;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
import java.util.Arrays;

/**
 * @Author : lizhifeng
 * @create 2022/8/8 10:42
 * @DESC 2022/8/8 10:42
 */


public class RIPEMD160 {


    private static BouncyCastleProvider provider;

    static {
        provider = new BouncyCastleProvider();
        Security.addProvider(provider);
    }

    public static byte[] hash160(byte[] data) throws NoSuchAlgorithmException {
        MessageDigest md = MessageDigest.getInstance("RipeMD160");
        return md.digest(data);
    }


    public static void main(String[] args) throws NoSuchAlgorithmException {

        byte[] result = hash160("123456".getBytes());
        System.out.println(Arrays.toString(result));

    }


}
